9. Jupyter Book rendering demo

JupyterBook allows for rendering of notebooks as static HTML that can be rendered on github pages. This notebook demonstrates some of the more advanced rendering available within a notebook that doesn’t require a kernel back-end.

This notebook is therefore a demo of the potential benefits that could be gained if Max Fordham rendered project information in website form.

9.1. Datafames

9.1.1. Scrollable rows and columns

import pandas as pd
import numpy as np
import seaborn as sns

bigdf = pd.DataFrame(np.random.randn(16, 100))
bigdf.style.set_sticky(axis="index")
bigdf.index = pd.MultiIndex.from_product([["A","B"],[0,1],[0,1,2,3]])
bigdf.style.set_sticky(axis="index", pixel_size=18, levels=[1,2])
      0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
A 0 0 2.382567 -0.366115 0.557658 -0.664831 0.835495 1.954134 0.665683 -0.368407 -0.115111 0.656782 0.484620 0.897054 1.108209 0.324679 -0.044146 1.032495 0.952619 0.287777 1.883070 0.841472 -0.200215 0.391362 0.469603 -2.490653 -0.291261 -1.645531 0.940738 0.728758 0.156127 0.757716 0.471161 -0.420716 0.005616 -0.690197 -0.055998 1.013362 0.286859 -0.487578 0.606898 -0.313590 -0.038433 -1.674938 -0.766565 -1.196697 -0.332289 -0.116498 -0.785596 -1.289045 0.275961 0.101709 -0.147283 2.952434 2.452900 -0.535458 -1.680202 -0.546217 -0.936668 -1.068608 1.623904 -1.692721 0.561898 1.627143 -1.146099 -0.252173 -0.952781 0.576381 0.000991 -1.901548 0.021280 0.625336 -0.304287 0.161668 0.319129 -0.578851 -0.801255 0.120844 1.048365 -0.161547 0.465103 -0.507252 1.006815 0.087783 -0.650559 -0.945533 1.289863 1.706057 0.340036 -0.396722 0.783350 -0.038791 -0.026484 -0.415506 -0.245987 -0.002799 -0.329959 -0.987087 -2.279304 0.303135 -0.558601 1.025850
1 0.116238 -0.443878 1.175683 1.084195 -1.960097 -1.556497 -0.586271 0.089546 1.384150 -1.263342 -0.124466 0.647251 -0.015950 0.513837 -1.415978 1.257769 -0.117449 -0.925959 0.715946 -0.245263 -1.165957 0.237894 0.361714 -1.340167 0.874593 -1.143793 -1.077578 0.375509 0.177571 0.025491 0.884649 0.261774 0.230553 -0.879627 1.284917 -0.154065 -0.362925 0.678740 1.064424 -0.857600 -2.418836 -1.356067 -1.474729 -0.735651 0.747273 -0.400491 1.013973 -0.009273 -1.526041 0.339073 -0.121834 0.515133 -0.515017 -0.432223 0.135624 -0.189935 -0.408311 0.064836 0.538341 -0.491848 -0.155099 0.819829 -0.310742 -0.203793 -0.037310 -0.709347 0.193397 0.183431 -1.634266 -1.585398 0.478969 -0.764173 0.938013 -0.681313 0.080939 -0.950298 0.793916 0.194092 -0.479681 -0.932210 -0.141168 0.092411 -1.142527 -1.094360 1.191585 -0.648014 -0.164815 -1.102982 0.644102 0.267057 1.050517 -0.747248 -2.144789 0.058920 -0.984830 0.048044 0.754446 -0.450885 1.496578 -0.076809
2 0.580413 -0.400190 -0.629693 -0.144306 0.538994 0.647386 -0.737390 1.245726 -2.132433 -1.057771 -1.793271 0.776797 -0.242994 -0.728209 -0.228085 -1.279561 0.487455 -0.248690 1.686996 1.338107 -0.589741 -0.234190 -1.814290 1.489792 -0.444902 1.650688 1.089310 -0.375614 -0.278991 0.288300 0.078918 0.562907 -0.571927 -0.761642 -1.369383 -1.009101 0.323129 0.262692 0.313609 0.100656 1.076025 0.197505 -0.149978 1.910878 -0.663816 0.104933 0.678514 0.887806 0.013067 -0.162084 -0.206398 1.120226 0.868379 -0.118118 0.926933 -1.563040 -0.433816 1.730356 -1.188988 0.056236 -1.028707 0.695100 -0.488476 0.267960 -0.115878 -0.620612 0.030485 0.646726 0.985255 -1.257196 0.709446 0.896847 1.775388 -1.323731 1.226024 0.043789 2.836764 1.304290 -0.506120 -0.510094 -0.360571 0.591913 -0.070261 -0.197612 -0.860243 -1.455330 0.836408 -1.080555 1.715779 1.071979 0.223610 -1.343127 -0.965096 1.087145 -0.014669 -1.065852 -0.535280 0.810102 0.727832 1.186269
3 0.295725 -0.554829 -0.800784 -0.204626 0.406501 -0.420220 1.426586 1.854639 0.543289 -0.611762 0.643169 0.729763 1.145084 0.203861 -0.176613 -1.641975 0.137675 -1.308970 0.352559 -1.588271 -1.321160 -0.706321 0.870029 0.619159 -0.976653 0.237466 2.801098 -0.325783 1.068577 -1.392142 1.354442 -1.495562 0.375764 -0.441076 1.005404 -0.094610 0.396423 -2.557751 0.043208 0.546591 0.042055 -1.081281 0.572299 1.380722 0.827217 1.115164 0.123265 0.117129 -0.382352 -0.764549 0.100929 -0.727438 1.181679 -1.786925 -0.548386 -1.220384 2.396521 -0.182880 2.510454 -0.359335 0.306437 -2.043144 1.647732 0.298717 0.238062 0.439996 2.257054 -0.273186 0.522416 -0.845245 -1.221356 0.237780 0.357228 1.412235 -0.434649 -0.401795 -0.391771 -0.252551 -0.738712 -0.193499 -1.069602 2.151684 2.050591 -1.017961 0.104957 -0.473269 -0.595158 -1.036657 1.308930 -0.431289 -0.525443 -0.451671 -0.023480 0.665993 1.238915 0.431746 0.795486 0.214934 0.948034 -1.144400
1 0 1.212943 -0.308195 -0.101841 1.798817 1.103482 1.034667 -1.111087 0.155730 -0.029824 0.729520 0.752015 -0.657542 0.318135 0.694861 -0.828343 0.845931 0.941350 -1.844360 1.769230 0.784677 -0.512618 0.326784 -0.894633 -0.344530 0.045181 -1.257245 -1.068752 0.228916 -0.264374 0.611461 0.934955 0.579632 -1.431078 -0.183959 0.640079 0.100406 -0.019683 -0.136755 0.636580 -0.211653 -0.543296 2.185126 0.712915 0.545632 0.321013 0.180921 1.807105 -1.262867 0.774307 0.525931 -0.235564 -0.959720 1.605426 -1.154497 -0.595928 -0.340907 -0.060621 0.290152 2.235077 -0.996625 1.668034 -1.300645 -0.976425 2.131847 -0.652947 0.078169 0.803909 -0.026284 -0.247404 0.120032 0.414555 -0.519874 1.276997 0.406993 0.566409 0.477188 0.361631 1.630797 -0.718511 -1.286004 -0.020662 0.615800 1.613372 -0.303426 -0.854116 -1.163874 -0.591899 -0.092419 -0.376093 -0.360283 0.783036 -0.945327 0.949730 1.558851 0.035796 -1.825266 0.906543 -0.009564 0.963729 1.584366
1 -0.468169 0.853518 0.264317 0.552318 1.366618 -0.191472 -1.118042 -1.305479 0.620488 -1.915325 0.509132 2.304558 0.145554 1.253713 -1.065073 0.695809 -1.187731 -1.843888 0.453814 0.236414 1.884509 0.054318 0.075238 -0.287861 -0.890191 1.265972 0.594974 -0.084923 0.098684 2.463834 0.694472 -1.840708 0.358997 1.197948 1.427410 -1.397388 -0.516336 0.356895 -0.305023 -0.035982 -0.529533 -0.471494 -0.181846 1.400707 0.781926 -0.715239 -0.780602 1.251039 0.192728 0.172731 1.402912 1.194995 -0.780542 -0.373501 1.387623 -0.149543 0.216890 0.631922 -0.418326 0.070729 -1.513784 -1.056266 1.248888 -0.829281 0.593187 -1.890325 0.339434 -0.416105 -1.838303 -1.700761 -0.615413 1.231630 -1.223441 0.113750 1.066074 0.461704 1.698554 0.142745 -0.020314 0.376593 -1.341313 0.150938 0.225426 -0.177563 -0.808650 -0.537842 1.999133 -0.328621 -0.912989 1.275569 0.219016 -0.581254 -0.307794 0.261700 0.348822 2.206438 1.504759 2.196615 0.032036 1.566145
2 -1.830480 -0.091670 -0.955237 0.554662 1.278771 -0.994391 -1.422041 -0.493153 0.338557 2.083613 0.424796 -1.323176 0.120471 1.467858 -0.636108 0.636475 -0.576067 0.565875 0.064327 0.836094 0.278690 0.215602 0.357309 -0.746734 1.204008 -0.216494 -0.186859 -1.215082 1.070129 0.488311 -0.241406 -0.388656 -0.284716 1.542556 2.493028 -1.545502 1.750798 -1.100751 0.479862 0.826816 -1.382864 0.736424 -1.607006 0.794590 1.239495 -0.226338 -0.651624 0.559571 -1.872582 1.396984 1.678904 1.611162 -0.553023 -0.676565 1.064447 -0.551651 -0.188737 -1.176398 1.974062 0.028482 0.250090 -0.281867 1.422385 1.438286 0.968022 -0.474351 -0.899892 0.536258 -1.617496 0.719522 0.301976 -1.336170 -1.223432 0.754245 -0.656260 -1.685235 0.277805 0.493391 -1.070238 1.682238 -1.250101 0.412591 1.184982 -1.104273 1.519712 0.722616 1.991065 -0.720265 1.000041 2.305633 -0.418452 0.736133 -1.197609 -1.014205 -0.468281 1.096764 0.928490 0.168468 0.497205 0.766969
3 0.347870 0.044072 0.048169 0.923872 0.534068 1.938469 0.898314 0.757853 0.001143 2.326985 2.487596 -0.264885 -0.122948 -1.390487 -0.098913 0.431923 -0.757297 0.993443 1.140250 0.484460 -0.822150 0.514211 0.186161 -1.481485 0.560449 0.634470 1.407460 -2.462602 1.595949 0.315789 -0.551178 0.867531 1.184343 0.196213 -0.218880 0.472936 -1.628110 0.569211 0.329656 -0.278311 0.444010 -0.258620 0.472207 3.556944 0.664850 0.995641 -0.953631 -0.463084 0.072490 0.136073 -0.265933 -1.094625 -0.262885 0.746518 0.161518 0.828579 -0.357390 0.740023 0.971866 -0.592030 -0.237179 0.008949 1.264286 -1.629333 -0.572131 0.502670 -2.029035 -0.613190 0.519834 2.281567 0.206105 -0.472656 0.299598 -0.720954 0.784989 -0.256760 1.126369 1.043106 -1.742346 0.429154 1.024996 0.482880 -1.195587 0.019186 0.087555 -1.100326 -0.142689 -0.340034 -0.993220 -1.051744 -0.429126 0.068979 0.101855 -0.816812 -0.529309 -0.539743 0.142795 0.107380 -0.468597 0.053346
B 0 0 0.459400 -0.601375 0.285065 -2.075071 -0.014827 0.130013 0.820170 1.683068 -0.679173 -0.471859 0.200940 1.062378 0.307619 -1.154287 0.780528 0.150714 -0.298773 1.179696 0.865082 -0.064499 0.063427 1.625363 0.288475 1.091912 -0.320873 0.388410 -0.630699 0.382831 -0.930978 0.336014 0.241251 0.479576 0.611252 0.594369 0.240569 1.109940 -1.657268 -1.173017 -1.162524 0.417924 -0.575449 -1.682934 0.706613 0.527600 -1.608655 -0.392301 0.567286 -0.716065 0.714482 -0.164846 2.562434 0.650254 1.338394 0.613706 0.938400 -1.715826 -2.432646 0.552791 0.969468 -1.194621 -0.599489 0.294600 -0.775876 -0.918752 1.852641 -0.354282 -0.038411 -1.204280 0.128909 0.450259 0.827553 1.858751 -0.280004 0.167944 -0.717034 -0.853947 0.942272 1.081446 -1.610960 -0.734699 0.475311 0.137523 -0.817953 1.329963 0.047301 -1.492375 -0.136824 0.856507 -0.101175 -0.843702 0.116418 1.169822 1.169685 0.459676 -0.450300 0.776232 -1.069592 1.449464 0.346288 -0.027327
1 -1.215251 -0.821252 -0.391199 -1.422279 0.553133 -0.535749 -1.689335 -0.007391 -1.479855 0.456539 -0.378622 -0.303189 -0.899496 -0.327884 -0.832785 1.342890 -1.455159 -1.157302 0.934707 0.298551 -1.541227 -0.158034 -1.072718 -1.113799 0.620873 0.801457 -1.582746 0.333852 -0.217916 0.760533 -0.784959 -0.325863 -0.624431 0.133689 -0.904081 -0.914246 1.002418 0.972270 -0.622757 -1.505427 1.115448 0.023394 0.135708 0.509281 0.400317 1.174205 0.560137 -0.114614 1.406565 -0.096146 1.310000 -1.646080 -0.375686 1.310320 -0.944817 -1.902008 -1.172197 0.462889 0.842356 -1.794003 1.932277 1.392029 -1.665794 1.683022 1.212769 -0.031089 0.005719 -0.381205 0.139080 -0.090234 -0.555461 0.170293 1.214807 0.254823 1.405782 0.830921 -0.619591 1.002977 -1.045031 -0.320345 -0.392865 -0.303147 -2.105316 -0.123855 -0.671828 -0.290384 0.609532 0.294488 -0.842657 -0.114083 -0.906075 -0.350274 0.946776 -1.182532 0.383858 -0.489426 -0.378877 -0.421451 1.884533 1.323844
2 -0.532535 0.085980 -0.767587 -0.583060 -1.296777 -1.402512 -0.726151 0.011771 -0.186523 0.727012 -1.074294 -2.005422 0.257489 -0.122924 1.411214 0.648880 1.090109 -1.258731 0.337773 1.917613 1.286937 1.277638 -0.828387 0.750602 1.030070 1.261208 -0.107001 -0.587551 2.282927 -0.064276 0.209290 -0.885689 -0.813463 -1.338397 -0.633291 -1.583227 -0.801760 -0.723098 0.285558 -1.953843 1.247360 1.373679 -0.212383 0.242644 0.601677 1.008073 -1.889196 -0.743006 -1.294518 -0.883391 0.738963 1.451128 0.860468 0.832062 0.487813 0.266627 1.204018 0.879512 -1.101101 -0.880223 0.581964 0.046344 -0.872725 -0.602020 -0.649377 1.354713 0.378937 -1.027900 -0.175334 1.491548 -1.387491 1.515932 1.130327 0.680855 -1.527024 -0.569499 0.603285 -0.363589 0.254670 1.578272 1.147819 1.767729 2.390488 0.566974 -0.198688 0.662506 1.022805 -0.923945 2.248170 0.257699 -1.052785 -1.125410 -0.138653 -1.921168 -0.455760 0.126335 0.822543 -0.844678 -0.099579 0.545376
3 -0.843510 -0.422450 -0.231087 0.127340 -0.617632 0.048497 2.590699 0.939502 -0.950938 1.118706 1.051306 -0.503214 -0.112888 1.282038 -0.995393 -0.935571 -0.376532 0.522462 0.699264 -0.631623 0.192901 -2.104956 -0.052448 0.573226 1.013290 -2.284557 0.825197 -0.367821 1.139766 0.762860 -0.404911 -0.287082 0.600770 -0.319634 -0.138677 0.239747 -0.678396 0.324573 0.740648 0.478901 -0.917041 -0.350679 -0.930641 0.104515 0.446224 0.245341 -0.266591 -0.781821 2.323402 -0.115572 -1.167330 0.223046 -0.150735 -0.899841 -0.161491 -1.196497 -0.926869 0.132727 0.103766 -0.794076 -0.483524 0.108567 0.642826 -1.017470 -0.876405 0.596789 0.024714 -2.976549 0.038074 -0.227564 0.691566 -0.297691 -0.486745 0.731969 -0.005756 1.127657 0.545963 0.219669 -1.425283 -1.028078 -1.288558 0.280222 0.291455 -1.014612 0.414394 0.224030 1.976970 0.458422 -0.845688 -0.732309 -2.081289 -0.677846 -1.773047 -0.415814 -0.498855 1.712163 0.938097 0.080081 0.068582 -1.475523
1 0 1.146615 -0.514132 -0.262731 2.158596 -0.181601 0.647311 -0.789919 -0.923033 0.318477 0.257426 -2.192994 -2.126047 2.214265 0.116237 -0.996085 0.364501 2.652130 -0.966522 0.357104 1.192450 0.152279 1.266658 1.275736 0.176370 0.136984 -0.988254 -2.294912 -1.383680 -1.805022 0.610293 1.085849 0.500348 0.439243 -0.350648 1.091446 -1.230940 -0.289741 -1.525424 0.943445 1.118990 -1.693179 -1.006906 -0.235284 -2.452713 -0.381478 -1.206437 -1.118681 -0.123651 1.372822 -0.130516 0.279951 -0.832751 0.618043 1.025478 -0.244929 -0.909467 1.319651 1.265609 0.038733 -0.620497 0.382305 -0.031870 -0.526000 -1.459089 0.502283 -0.695706 1.722131 1.576138 0.887439 -2.352689 1.244677 -0.381995 0.010131 1.434111 -0.103049 -1.546481 -1.257399 0.185369 -0.502086 1.315315 1.431982 0.026054 0.427157 -0.881154 -1.768083 0.912838 1.150863 1.746039 0.105103 0.528541 -0.651600 -0.956531 0.230586 0.571426 0.303213 0.484206 -0.169238 -0.317531 2.161250 1.466920
1 1.136249 -1.185498 -0.704793 -0.112256 0.205525 -0.449714 -0.928105 0.283198 -0.931132 -1.256108 -0.749277 0.958508 -0.121319 -0.324304 0.637746 -0.050763 -0.477827 1.064572 0.195096 1.416875 -0.192327 -0.244737 -0.728764 1.271619 2.717296 1.681912 -0.196644 -2.623497 0.029211 -1.280346 0.378626 1.100078 -0.342296 2.001615 -0.229838 -1.806732 0.125530 0.918649 -1.688849 1.315206 -0.246844 0.223395 -2.332307 -0.146011 -0.691161 0.239015 -0.008891 0.347039 0.470632 0.973858 -1.495623 1.319591 -0.542254 -1.508146 0.854126 -0.838720 0.615280 -0.260175 0.398661 1.259764 0.707501 0.273062 1.995519 -0.975508 -0.211895 0.398510 0.006858 0.044920 -0.473894 1.439124 -0.200294 -0.007817 -0.721084 -0.879559 0.250829 -0.191358 -0.335407 0.930328 -0.747818 0.570704 0.466498 -0.088822 1.640233 -0.325685 1.122654 -0.770161 -0.436831 -0.224351 1.415834 -1.302630 -0.407235 -0.130251 -0.209612 0.873595 1.347421 1.705249 -1.355399 -0.802377 -1.358494 0.954765
2 -0.247476 1.544080 0.985983 1.268582 -0.641515 0.058305 -0.419828 -0.619741 -2.301871 0.386172 1.762626 1.103954 -0.250064 0.607454 0.166568 0.706272 0.462333 0.560312 -0.818931 -1.320092 -0.862388 -0.493889 0.054676 0.226539 0.631331 -1.168320 0.143763 -0.729235 0.904915 -1.364590 -0.844223 -1.102461 0.816706 0.252104 1.012267 1.714351 0.676751 0.339926 0.446285 1.080495 0.181720 0.969337 -1.448099 0.148862 -0.902877 0.803215 0.625122 1.539475 0.385962 -2.309464 0.339638 1.143349 -0.869058 1.624754 -0.868038 0.199452 0.220047 -0.608909 0.249834 0.332779 0.491290 1.727138 0.513404 -0.231305 1.445905 0.112643 1.115950 -0.436772 0.870507 0.249956 -0.351798 -1.307309 0.003591 -0.470294 2.417482 -0.379958 0.534494 2.348385 -0.429727 -0.106239 0.208533 1.106106 -1.291115 0.379663 0.297566 -0.365885 -0.030746 -0.212081 -0.442684 0.946027 0.670561 -0.210190 1.317724 2.028011 0.163366 0.362027 -1.214088 0.194167 -0.705048 -0.123811
3 -1.502898 0.431541 0.314631 0.418837 1.481303 1.316319 -1.099570 1.607113 0.089352 1.042135 -0.751763 0.111996 2.439787 0.310697 -1.023199 -1.187205 0.311177 -0.009610 0.265392 -1.730650 1.641958 0.629503 -0.943226 -0.817312 -1.229002 0.711257 -0.183468 1.018766 0.965184 -0.203537 -1.265057 -0.389237 0.312134 -0.358310 -1.011524 0.361708 0.082433 0.149215 0.010264 -1.289319 -1.936463 -0.846807 0.748748 1.648061 -0.472881 -0.126606 1.834691 2.163115 -0.224613 0.220724 -0.609507 -0.351402 0.631615 1.132841 1.177203 0.660060 -0.096271 -0.731123 -1.052343 -0.185917 0.052557 -1.155445 -0.113235 0.795825 -0.268478 -0.807600 -1.289515 0.184147 -0.794034 0.446083 -0.599057 0.804340 0.033485 0.764205 -0.541655 -0.443104 0.338469 0.560386 1.280288 0.631760 1.156484 0.137149 2.526064 1.863130 -0.064466 -0.511327 0.896637 0.810363 0.104708 0.402863 0.021350 0.283548 0.211075 -0.134018 0.416493 0.553399 -0.311046 -0.154044 -1.217793 0.435554

9.1.2. Styling

def magnify():
    return [dict(selector="th",
                 props=[("font-size", "4pt")]),
            dict(selector="td",
                 props=[('padding', "0em 0em")]),
            dict(selector="th:hover",
                 props=[("font-size", "12pt")]),
            dict(selector="tr:hover td:hover",
                 props=[('max-width', '200px'),
                        ('font-size', '12pt')])
]

np.random.seed(25)
cmap = cmap=sns.diverging_palette(5, 250, as_cmap=True)
bigdf = pd.DataFrame(np.random.randn(20, 25)).cumsum()

bigdf.style.background_gradient(cmap, axis=1)\
    .set_properties(**{'max-width': '80px', 'font-size': '1pt'})\
    .set_caption("Hover to magnify")\
    .set_table_styles(magnify())
Hover to magnify
  0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
0 0.228273 1.026890 -0.839585 -0.591182 -0.956888 -0.222326 -0.619915 1.837905 -2.053231 0.868583 -0.920734 -0.232312 2.152957 -1.334661 0.076380 -1.246089 1.202272 -1.049942 1.056610 -0.419678 2.294842 -2.594487 2.822756 0.680889 -1.577693
1 -1.747981 1.560230 -1.130455 -1.104701 1.025738 0.003675 -2.459820 3.445575 -1.664939 1.268315 -0.515258 -0.015310 1.519518 -1.088040 -1.863166 -1.132030 -0.683069 -0.806861 0.351129 -0.055050 1.791890 -2.820239 2.257219 0.784284 0.440715
2 -0.653732 3.222665 -1.757908 0.516498 2.203870 -0.371203 -3.004149 3.733337 -1.870759 2.458303 0.213669 -0.237350 -0.103188 -0.775499 -3.023587 -0.818470 -0.211071 -0.228999 0.856536 -0.681538 1.445521 -4.886181 3.026155 1.913150 0.607639
3 -1.620988 3.714661 -2.308765 0.431804 4.171439 -0.433878 -3.855285 4.159857 -2.148320 1.080358 0.118473 0.596289 -0.887942 0.270645 -3.669371 -2.710049 -0.308404 -1.587895 1.354846 -1.828858 0.909000 -5.802670 2.814007 2.105995 0.284955
4 -3.348641 4.478728 -1.863451 -1.703772 5.191803 -1.021275 -3.807248 4.720027 -0.724127 1.077167 -0.179294 0.829012 -0.215989 -1.075636 -4.271094 -2.879245 -0.966785 -1.783919 1.532398 -1.796564 2.212258 -6.342154 3.343925 2.488792 2.085578
5 -0.835023 4.233717 -1.654723 -2.004623 5.344795 -0.990296 -4.132202 3.942754 -1.061569 -0.943343 1.240477 0.087122 -1.775907 -0.109346 -4.453389 -0.851705 -2.057086 -1.353887 0.801447 -1.632429 1.539048 -6.510822 2.802080 2.136327 3.774363
6 -0.742661 5.354728 -2.105947 -1.132570 4.202655 -1.849968 -3.201510 3.764827 -3.219971 -1.232603 0.335696 0.574738 -1.817876 0.540041 -4.434264 -1.829508 -4.029952 -2.620025 -0.199518 -4.682319 1.933769 -8.458161 3.335411 2.515490 5.814434
7 -0.435425 4.685541 -2.302523 -0.209710 5.929903 -2.625028 -1.834755 5.458698 -4.502776 -3.164846 -1.727800 0.179197 0.107779 0.036326 -5.992569 -0.449496 -6.199288 -3.889734 0.705826 -3.945140 0.673408 -7.256618 2.967961 3.394341 6.658520
8 0.916429 5.801350 -3.332729 -0.653992 5.987326 -3.187774 -1.830254 5.632341 -3.532148 -1.297564 -1.607920 0.819819 -2.445732 -0.403640 -6.055523 -0.516571 -6.595947 -3.484149 -0.043367 -4.599056 0.506327 -5.846181 3.227209 2.404915 5.075509
9 0.376610 5.536388 -4.489246 -0.801407 7.050450 -2.638456 -0.442983 5.346094 -1.958536 -0.334609 -0.800901 0.257086 -3.369133 -0.817936 -6.051681 -2.613163 -8.454623 -4.452364 0.413516 -4.709704 1.892156 -6.928920 2.137670 3.000518 5.156884
10 2.060955 5.841548 -3.898911 -0.978667 7.780829 -2.490799 -0.593360 5.589822 -2.221739 -0.712894 -0.460900 1.801778 -2.789647 0.483587 -5.966297 -3.440078 -7.774100 -5.486767 -0.697201 -4.610612 -0.519246 -7.724329 1.540940 5.017456 5.807623
11 1.855296 4.474482 -2.167637 -1.379254 5.903561 -0.493331 0.017455 5.784527 -1.043477 -0.602371 0.486087 1.959712 -1.469682 1.882571 -5.916993 -4.546449 -8.150600 -3.424959 -2.243608 -4.333677 -1.165976 -7.898138 1.364929 5.307307 5.831837
12 3.185193 4.223344 -3.060307 -2.265861 5.927409 -2.644635 0.334465 6.721082 -2.836873 -0.195052 1.893613 2.628929 -1.533384 0.748152 -5.273227 -4.530257 -7.565627 -2.852125 -2.169530 -4.781844 -1.133386 -8.994666 2.110373 6.419506 5.598108
13 2.311778 4.454278 -3.865717 -2.049095 6.763108 -3.254570 -2.169981 7.989809 -2.560643 -0.795488 0.712662 2.334485 -0.160684 -0.461331 -5.095010 -3.790941 -7.579271 -4.000575 0.327317 -3.669284 -1.048012 -8.706202 2.470084 5.871868 6.711746
14 3.776661 4.326652 -3.880724 -1.581459 6.218718 -3.234565 -1.464375 5.569291 -2.934611 -0.327696 -0.972011 1.718296 3.613457 0.287798 -4.206806 -4.098502 -6.683742 -4.503725 -2.194553 -2.428166 -1.639656 -9.364028 3.360458 6.110140 7.534624
15 5.643632 5.311834 -3.977693 -2.258677 5.908270 -3.296217 -1.029720 5.682457 -3.057448 -0.330941 -1.160598 2.193163 4.200311 1.009660 -3.223671 -4.306914 -5.735806 -4.436561 -2.295107 -1.361200 -1.203956 -11.272952 2.586907 6.690612 5.914432
16 4.075839 4.339518 -2.441356 -3.304695 6.036980 -2.515758 -0.470885 5.280210 -4.843205 1.582830 0.229670 0.099199 5.785316 1.798015 -3.134796 -3.853625 -5.526188 -2.974892 -2.130464 -1.145860 -0.556230 -13.125711 2.072853 6.162077 4.935564
17 5.639779 4.567669 -3.533112 -3.755907 6.575382 -2.580044 -0.749446 6.577283 -4.778264 3.633654 -0.287753 0.555648 5.764089 2.045579 -2.265157 -2.314014 -4.953443 -3.160439 -3.061884 -2.425741 0.840436 -12.573104 3.557741 7.356074 4.698601
18 5.990735 5.821280 -2.846417 -4.150237 7.124746 -3.322755 -1.214789 7.929950 -4.853968 1.435960 -0.626733 0.352030 7.465647 0.874774 -1.517952 -2.087865 -4.228000 -2.548817 -2.456205 -2.891122 1.897258 -9.736592 3.431567 7.069366 4.387275
19 4.031716 6.229280 -4.098862 -4.105298 7.190747 -4.101052 -1.518843 6.529479 -5.209717 -0.235366 0.007198 1.156140 6.431527 -1.972977 -2.639055 -1.657322 -5.199643 -3.254875 -2.872984 -1.654209 1.643452 -10.660801 2.834048 7.483650 3.937078

9.2. GeoJson with deck.gl rendering

"""
GeoJsonLayer
===========

Property values in Vancouver, Canada, adapted from the deck.gl example pages. Input data is in a GeoJSON format.

Reference: https://deckgl.readthedocs.io/en/latest/gallery/geojson_layer.html
"""

import pydeck as pdk

DATA_URL = "https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/geojson/vancouver-blocks.json"
LAND_COVER = [[[-123.0, 49.196], [-123.0, 49.324], [-123.306, 49.324], [-123.306, 49.196]]]

INITIAL_VIEW_STATE = pdk.ViewState(latitude=49.254, longitude=-123.13, zoom=11, max_zoom=16, pitch=45, bearing=0)

polygon = pdk.Layer(
    "PolygonLayer",
    LAND_COVER,
    stroked=False,
    # processes the data as a flat longitude-latitude pair
    get_polygon="-",
    get_fill_color=[0, 0, 0, 20],
)

geojson = pdk.Layer(
    "GeoJsonLayer",
    DATA_URL,
    opacity=0.8,
    stroked=False,
    filled=True,
    extruded=True,
    wireframe=True,
    get_elevation="properties.valuePerSqm / 20",
    get_fill_color="[255, 255, properties.growth * 255]",
    get_line_color=[255, 255, 255],
)

r = pdk.Deck(layers=[polygon, geojson], initial_view_state=INITIAL_VIEW_STATE)

r.to_html()

9.3. Interactive visualisations

plotly below, but Altair / Vega also available

import plotly.io as pio
import plotly.express as px

df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species", size="sepal_length")
fig

9.4. .obj 3d object rendering

from pygel3d import hmesh, gl_display as gl
from pygel3d import jupyter_display as jd

m = hmesh.load("data/bunny.obj")

jd.set_export_mode(True)
jd.display(m, smooth=False)

9.5. PDF rendering

from IPython.display import HTML
fpth = "../_data/BMSDataDrivenWaterfall_resize.pdf"
HTML(f"""
<div class="admonition note" name="html-admonition" style="background: lightgreen; padding: 10px">
<p class="title">This is an example of an embedded pdf</p>
<iframe src="{fpth}" width="100%" height="800px" frameBorder="0"> </iframe>
""")

This is an example of an embedded pdf